<?php 
 class LoginController extends Controller{
    private $model;
    public function __init(){
    	$this->model=K("User");
    }
 	/**
	 * 验证码
	 */
 	public function code(){
 		$code=new Code;
		$code->show();
 	}
	/**
	 * 显示页面
	 */
 	public function index(){
 		$this->display();
 	}
	/**
	 * 登陆
	 */
	 public function login(){
	 		if(IS_POST){	  			 
		        if(!$this->model->login_admin()) $this->error($this->model->error);
				$this->success('登陆成功',U('Index/index'));
			}
		 
	 }
	 /**
	  * 退出
	  */
	 public function out(){
	 	session(NULL);
		$this->success("退出成功");
	 }
	 
	 
	 
 }


 ?>